# -*- coding: utf-8 -*-

from django.db import models

class ModelTypes :
    Type_Item = 6
    Type_Skill = 7
    Type_Task = 9
    Type_Card = 13
    Type_Map = 1
    Type_Campaign = 2
    Type_Battle_point = 3
    Type_Level_prop = 34
    Type_Npc = 4
    Type_Npc_unit = 5
    Type_Shop_item = 16
    Type_Tavern = 35
    Type_Versus_battle_point = 28
    Type_Constants = 24
    Type_Forge_item_data = 29
    Type_Item_fragment = 14
    Type_Item_extra_prop = 31
    Type_Item_perfect_prop_data = 30
    Type_Home = 23
    Type_Open_bag = 33
    Type_Silver_bag = 26
    Type_Gift_bag = 25
    Type_Treasure = 27

class Language(models.Model) :
    id = models.AutoField(primary_key=True)
    type= models.IntegerField('分类',null=False)
    deployId = models.IntegerField('对应项',null=False)
    key = models.CharField('键名',max_length=500,null=False)
    value = models.CharField('键值',max_length=500,null=True)


class Item(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    name = models.CharField('名字',max_length=500,null=True)
    desc = models.CharField('描述',max_length=500,null=True)
    categoryId = models.IntegerField('道具大类',null=False)
    typeId = models.IntegerField('道具小类',null=False)
    attackType = models.IntegerField('攻击方式',null=False)
    level = models.IntegerField('等级',null=False)
    qualityId = models.IntegerField('品质',null=False)
    enchantTime = models.IntegerField('最大免费强化次数',null=False)
    bindType = models.IntegerField('绑定类型',null=False)
    props = models.CharField('道具基础属性',max_length=500,null=True)
    propertySet = models.CharField('道具属性集',max_length=500,null=True)
    requiredLevel = models.IntegerField('英雄等级下限',null=False)
    requiredCareerId = models.IntegerField('职业要求',null=False)
    requiredGenderId = models.IntegerField('性别要求',null=False)
    unique = models.IntegerField('是否唯一拥有',null=False)
    maxStack = models.IntegerField('最大叠加数量',null=False)
    recyclingPrice = models.IntegerField('回收价格',null=False)
    canSell = models.IntegerField('是否可以售卖',null=False)
    skillId = models.CharField('对应技能ID',max_length=500,null=True)
    itemres = models.CharField('资源SWF',max_length=500,null=True)	
	
    
class Skill(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    name = models.CharField('名字',max_length=500,null=True)
    desc = models.CharField('描述',max_length=500,null=True)
    category = models.IntegerField('分类',null=False)
    targetType = models.IntegerField('目标类型',null=False)
    damage = models.CharField('固有伤害',max_length=500,null=True)
    triggerDamage = models.CharField('触发伤害',max_length=500,null=True)
    status = models.CharField('基础状态',max_length=500,null=True)
    triggerStatus = models.CharField('触发状态',max_length=500,null=True)
    trigger = models.CharField('触发器',max_length=500,null=True)
    property = models.CharField('属性列表',max_length=500,null=True)
    changeFury = models.IntegerField('怒气改变值',null=False)
    sound = models.CharField('音效',max_length=500,null=True)
    skillres = models.CharField('资源SWF',max_length=500,null=True)	
	
    
class Task(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    name = models.CharField('名字',max_length=500,null=True)
    desc = models.CharField('描述',max_length=500,null=True)
    level = models.IntegerField('任务难度',null=False)
    catalog = models.IntegerField('任务大类',null=False)
    type = models.IntegerField('任务类型',null=False)
    dests = models.CharField('完成条件',max_length=500,null=True)
    compaignId = models.IntegerField('战役ID',null=False)
    postTaskId = models.IntegerField('后继任务',null=False)
    startTalk = models.CharField('任务前对话',max_length=500,null=True)
    endTalk = models.CharField('任务后对话',max_length=500,null=True)
    deduct = models.CharField('任务消耗',max_length=500,null=True)
    reward = models.CharField('奖励',max_length=500,null=True)	
	
    
class Card(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    name = models.CharField('名字',max_length=500,null=True)
    desc = models.CharField('描述',max_length=500,null=True)
    module = models.IntegerField('模块',null=False)
    catalog = models.IntegerField('目录',null=False)
    type = models.IntegerField('分类',null=False)
    quality = models.IntegerField('边框颜色',null=False)
    award = models.CharField('奖励',max_length=500,null=True)
    condition = models.CharField('完成条件',max_length=500,null=True)
    nextCardId = models.CharField('下一个图鉴',max_length=500,null=True)
    cardres = models.CharField('资源SWF',max_length=500,null=True)	
	
    
class Map(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    name = models.CharField('名字',max_length=500,null=True)
    campaignIds = models.CharField('战役点',max_length=500,null=True)
    mapres = models.CharField('地图资源',max_length=500,null=True)	
	
    
class Campaign(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    name = models.CharField('名字',max_length=500,null=True)
    desc = models.CharField('描述',max_length=500,null=True)
    battlePointIds = models.CharField('战点列表',max_length=500,null=True)
    status = models.IntegerField('状态',null=False)
    vip = models.IntegerField('VIP',null=False)
    mapId = models.CharField('地图ID',max_length=500,null=True)
    userLevel = models.IntegerField('用户等级',null=False)
    coorX = models.IntegerField('X坐标',null=False)
    coorY = models.IntegerField('Y坐标',null=False)
    music = models.CharField('音乐',max_length=500,null=True)
    frontCompaignIds = models.CharField('前置战役',max_length=500,null=True)
    afterCompaignIds = models.CharField('后置战役',max_length=500,null=True)	
	
    
class Battle_point(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    name = models.CharField('名字',max_length=500,null=True)
    desc = models.CharField('描述',max_length=500,null=True)
    npcId = models.CharField('NPC编号',max_length=500,null=True)
    campaignId = models.CharField('战役点编号',max_length=500,null=True)
    weatherIds = models.CharField('天气列表',max_length=500,null=True)
    roundMax = models.IntegerField('最大回合数',null=False)
    leaderDead = models.IntegerField('首领死亡结果',null=False)
    roundLimit = models.IntegerField('回合上限值',null=False)
    leader = models.CharField('首领',max_length=500,null=True)
    round = models.CharField('回合',max_length=500,null=True)
    endCondition = models.CharField('结束条件',max_length=500,null=True)
    attackerMax = models.IntegerField('参战人数上限',null=False)
    defenderMax = models.IntegerField('防守人数上限',null=False)
    areaId = models.IntegerField('战场大小',null=False)
    drops = models.CharField('掉落',max_length=1000,null=True)
    energyCost = models.IntegerField('消耗精力点数',null=False)
    passCount = models.IntegerField('过关胜利场数',null=False)
    difficulty = models.IntegerField('据点难度',null=False)
    starMax = models.IntegerField('最大星级',null=False)
    frontBattlePointIds = models.CharField('前置战点列表',max_length=500,null=True)
    afterBattlePointIds = models.CharField('后置战点列表',max_length=500,null=True)	
	
    
class Level_prop(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    exp = models.IntegerField('经验',null=False)
    energyMax = models.IntegerField('精力最大值',null=False)
    battleCount = models.IntegerField('出战人数上限',null=False)
    employeeCount = models.IntegerField('雇佣英雄上限',null=False)
    skillCount = models.IntegerField('技能数上限',null=False)
    hp = models.IntegerField('血量',null=False)
    physicalatk = models.IntegerField('物理攻击力',null=False)
    physicaldef = models.IntegerField('物理防御力',null=False)
    magicatk = models.IntegerField('魔法攻击力',null=False)
    magicdef = models.IntegerField('魔法防御力',null=False)
    award = models.CharField('升级奖励',max_length=500,null=True)
    logos = models.CharField('升级解',max_length=500,null=True)	
	
    
class Npc(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    name = models.CharField('名字',max_length=500,null=True)
    desc = models.CharField('描述',max_length=500,null=True)
    npcUnitIds = models.CharField('NPC英雄',max_length=500,null=True)
    npcres = models.CharField('npc资源',max_length=500,null=True)	
	
    
class Npc_unit(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    name = models.CharField('名字',max_length=500,null=True)
    desc = models.CharField('描述',max_length=500,null=True)
    level = models.IntegerField('等级',null=False)
    career = models.IntegerField('职业要求',null=False)
    gender = models.IntegerField('性别要求',null=False)
    npcId = models.CharField('所属NPC',max_length=500,null=True)
    idx = models.IntegerField('排列顺序',null=False)
    pos = models.IntegerField('位置',null=False)
    hp = models.IntegerField('血量',null=False)
    attackId = models.IntegerField('攻击顺序',null=False)
    physicalatk = models.IntegerField('物理攻击力',null=False)
    physicaldef = models.IntegerField('物理防御力',null=False)
    magicatk = models.IntegerField('魔法攻击力',null=False)
    magicdef = models.IntegerField('魔法防御力',null=False)
    furyAttackRate = models.IntegerField('怒气攻击速率',null=False)
    hardAttackRate = models.IntegerField('重击攻击速率',null=False)
    hurtIncValue = models.IntegerField('伤害增加值',null=False)
    hurtDecValue = models.IntegerField('伤害减少值',null=False)
    hurtIncPercent = models.IntegerField('伤害增加百分比',null=False)
    hurtDecPercent = models.IntegerField('伤害减少百分比',null=False)
    skills = models.CharField('技能列表',max_length=500,null=True)
    equipment = models.CharField('装备列表',max_length=500,null=True)
    style = models.CharField('头饰列表',max_length=500,null=True)
    npcunitres = models.CharField('npc英雄资源',max_length=500,null=True)	
	
    
class Shop_item(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    tabId = models.IntegerField('商城位置页',null=False)
    itemId = models.CharField('道具',max_length=500,null=True)
    coinPrice = models.IntegerField('金币价格',null=False)
    silverPrice = models.IntegerField('银币价格',null=False)
    status = models.IntegerField('状态',null=False)
    isDiscount = models.IntegerField('是否打折',null=False)
    coinPirceDiscount = models.IntegerField('金币折扣',null=False)
    silverPriceDiscount = models.IntegerField('银币折扣',null=False)
    levelLimit = models.IntegerField('等级下限',null=False)
    vipLevelLimit = models.IntegerField('VIP等级下限',null=False)
    rank = models.IntegerField('排名',null=False)
    shop_itemres = models.CharField('商城道具资源',max_length=500,null=True)	
	
    
class Tavern(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    level = models.IntegerField('等级',null=False)
    requiredLevel = models.IntegerField('等级需求',null=False)
    moneyType = models.IntegerField('币型',null=False)
    money = models.IntegerField('币值',null=False)
    npcRates = models.CharField('npc刷新规则',max_length=500,null=True)
    taskRates = models.CharField('任务刷新规则',max_length=500,null=True)	
	
    
class Versus_battle_point(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    level = models.IntegerField('等级',null=False)
    battlePointId = models.CharField('战役点',max_length=500,null=True)	
	
    
class Constants(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    energeBoostPeriod = models.IntegerField('精力补充间隔(s)',null=False)
    energeBoostUnit = models.IntegerField('单位补充精力点数',null=False)
    practiceDuration1 = models.FloatField('短时修炼时间（小時）',null=False)
    practiceDuration2 = models.IntegerField('中时修炼时间（小時）',null=False)
    practiceDuration3 = models.IntegerField('长时种修炼时间（小時）',null=False)
    practiceSpeedExtraExp = models.IntegerField('加速修炼附加经验百分比',null=False)
    practiceCostCoeff1 = models.FloatField('短时修炼银币系数',null=False)
    practiceCostCoeff2 = models.FloatField('中时修炼银币系数',null=False)
    practiceCostCoeff3 = models.FloatField('长时修炼金币系数',null=False)
    practiceSpeedCost = models.IntegerField('加速修炼金币数',null=False)
    practiceDirectlyFinishCost = models.IntegerField('立即完成金币数',null=False)
    practiceExpUnitCoeff1 = models.IntegerField('短时修炼经验系数',null=False)
    practiceExpUnitCoeff2 = models.IntegerField('中时修炼经验系数',null=False)
    practiceExpUnitCoeff3 = models.IntegerField('长时修炼经验系数',null=False)
    practiceSpeedItemId = models.CharField('修炼加速道具ID',max_length=500,null=True)
    versusItemId = models.CharField('切磋道具ID',max_length=500,null=True)
    versusLevelLimit = models.IntegerField('切磋等级下限',null=False)	
	
    
class Forge_item_data(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    count = models.IntegerField('当前强化等级',null=False)
    min = models.IntegerField('最小概率',null=False)
    max = models.IntegerField('最大概率',null=False)
    gold = models.IntegerField('消耗金币数',null=False)	
	
    
class Item_fragment(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    itemId = models.CharField('道具ID',max_length=500,null=True)
    type = models.IntegerField('类型',null=False)
    fragments = models.CharField('碎片列表',max_length=500,null=True)	
	
    
class Item_extra_prop(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    level = models.IntegerField('等级',null=False)
    property = models.IntegerField('属性类型',null=False)
    valueType = models.IntegerField('值类型',null=False)
    min = models.IntegerField('最大值',null=False)
    max = models.IntegerField('最小值',null=False)	
	
    
class Item_perfect_prop_data(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    itemQuality = models.IntegerField('品质',null=False)
    type = models.IntegerField('道具类型',null=False)
    prop = models.IntegerField('属性类型',null=False)
    min = models.IntegerField('最大值',null=False)
    max = models.IntegerField('最小值',null=False)	
	
    
class Home(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    homeId = models.IntegerField('家园编号',null=False)
    cellId = models.IntegerField('位置',null=False)
    level = models.IntegerField('等级',null=False)
    cardId = models.CharField('对应图鉴',max_length=500,null=True)
    taskId = models.CharField('对应任务',max_length=500,null=True)
    homeres = models.CharField('家园资源',max_length=500,null=True)	
	
    
class Open_bag(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    bagCount = models.IntegerField('背包数量',null=False)
    gold = models.IntegerField('耗费金币',null=False)	
	
    
class Silver_bag(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    itemId = models.CharField('道具ID',max_length=500,null=True)
    silvers = models.CharField('银币列表',max_length=500,null=True)	
	
    
class Gift_bag(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    itemId = models.CharField('道具ID',max_length=500,null=True)
    reward = models.CharField('明细',max_length=500,null=True)	
	
    
class Treasure(models.Model):
    id = models.AutoField(primary_key=True)
    deployId = models.IntegerField('发布ID',null=False)
    itemId = models.CharField('道具ID',max_length=500,null=True)
    items = models.CharField('包含道具',max_length=500,null=True)	
	
    